<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@page import="java.text.SimpleDateFormat" %>
<%@ taglib prefix="cnoj" uri="/cnoj-tags" %>
<jsp:include page="./base/include/common-header.jsp"/>
<jsp:include page="./base/include/import-resource.jsp"/>
<%
    SimpleDateFormat dateFormater = new SimpleDateFormat("yyyy");
    String year = dateFormater.format(new Date());
%>
<link href="${pageContext.request.contextPath}/css/register.css" rel="stylesheet"/>
<link href="${pageContext.request.contextPath}/css/common.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.cookie.js"></script>
<!--[if lt IE 9]>
<script type="text/javascript" src="${pageContext.request.contextPath}/plugins/bootstrap/js/respond.min.js"></script>
<![endif]-->

<!--[if lte IE 6]>
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/plugins/bootstrap/css/ie.css">
<script type="text/javascript" src="${pageContext.request.contextPath}/plugins/bootstrap/js/bootstrap-ie.js"></script>
<![endif]-->
<script type="text/javascript">
    $(document).ready(function () {
        setTimeout('initEvent()', 300);
    });
    $("#form-add").submit(function () {
        var userName = $("#username").val();
        // var password = $("#pass-word").val();
        // var code = $("#code").val();
        if (utils.trim(userName) == '') {
            utils.showMsg("请输入用户名！");
            $("#username").focus();
            return false;
        } else if (utils.trim(password) == '') {
            utils.showMsg("请输入密码！");
            $("#password").focus();
            return false;
        }
        utils.waitLoading("正在注册...");
        return true;
    });
</script>
</head>
<body>
<div class="full-header">
    <div class="navbar navbar-default navbar-static-top m-b-0" role="navigation">
        <div class="navbar-header">
            <strong><a class="navbar-brand" href="index">
                <img class="text-inline-block" alt="logo" src="${pageContext.request.contextPath}/images/logo.png"
                     style="height: 65px;width: 120px;"/>
                <h4 class="text-inline-block">${project.name }</h4></a></strong>
        </div>
        <div class="navbar-collapse collapse">

        </div>
    </div><!-- navbar-default -->
</div>

<div style="text-align: center;">
    <div style="width: 540px;height: 400px;margin: 10% auto;background-color: white;">
        <div class="layui-card-header" style="background:#1890ff">用户注册</div>

        <form class="form-horizontal" role="form" id="form-add" action="register/add.json" style="padding: 20px 0;" onSubmit="${project.addr }">
            <div class="form-group m-b-10">
                <label for="username" class="col-sm-3 control-label">用户名</label>
                <div class="col-sm-8 p-l-0">
                    <input type="text" class="form-control require" name="username" data-label-name="用户名"
                           id="username"/>
                </div>
            </div>
            <div class="form-group m-b-10">
                <label for="stuNo" class="col-sm-3 control-label">学号/工号</label>
                <div class="col-sm-8 p-l-0">
                    <input type="text" class="form-control require" name="stuNo" data-label-name="用户名"
                           id="stuNo"/>
                </div>
            </div>
            <div class="form-group m-b-10">
                <label for="password" class="col-sm-3 control-label">密码</label>
                <div class="col-sm-8 p-l-0">
                    <input type="password" class="form-control require" name="password" data-label-name="密码"
                           id="password"/>
                </div>
            </div>
            <div class="form-group m-b-10">
                <label for="fullName" class="col-sm-3 control-label">真实姓名</label>
                <div class="col-sm-8 p-l-0">
                    <input type="text" class="form-control require" name="fullName" data-label-name="真实姓名"
                           id="fullName"/>
                </div>
            </div>

            <div class="form-group m-b-10">
                <label for="orgId" class="col-sm-3 control-label">所属学院</label>
                <div class="col-sm-8 p-l-0">
                    <input type="text" class="form-control require cnoj-input-tree"
                           data-uri="op/queryTree/select_org_tree.json" data-is-show-none="yes" name="orgId"
                           id="orgId"/>
                </div>
            </div>

            <div class="form-group m-b-10">
                <label for="input04" class="col-sm-3 control-label">您的身份</label>
                <div class="col-sm-8 p-l-0">
                    <select class="form-control cnoj-select" data-uri="dict/item/user_type_front.json" name="roleType"
                            id="input04"></select>
                </div>
            </div>

            <div class="text-center">
                <button type="button" class="btn btn-primary cnoj-data-submit">
                    <i class="glyphicon glyphicon-ok-sign"></i> 确定注册
                </button>

                <button type="button" onclick="window.open('${project.addr }/login')">
                    <i class="glyphicon glyphicon-ok-sign"></i> 去登陆
                </button>
            </div>
        </form>
    </div>
</div>

<div class="full-footer">
    <div style="margin: 0 auto" role="navigation">
        <h4>版权：${project.copyright }</h4>
        <h4>版本号：${project.version }</h4>
        <h4>联系：${project.contactInfo }</h4>
    </div>
</div>
</body>
</html>
